#include <stdio.h>

int isPrime(int num) {
    if (num <= 1) {
        return 0;
    }
    
    for (int i = 2; i * i <= num; i++) {
        if (num % i == 0) {
            return 0;
        }
    }
    
    return 1;
}

int main() {
    int n, count = 0;
    
    printf("请输入一个正整数n");
    scanf("%d", &n);
    
    for (int i = 2; i <= n; i++) {
        if (isPrime(i)) {
            count++;
        }
    }
    
    printf("1到%d之间的素数个数为 %d\n", n, count);
    
    return 0;
}
